package com.view.houseon;

import com.presentacion.houseon.R;

import android.R.anim;
import android.R.integer;
import android.os.Bundle;
import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TabHost;
import android.widget.Toast;
import android.widget.TabHost.OnTabChangeListener;

public class CategoriasCasaActivity extends TabActivity implements OnClickListener {

	Intent intent;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_categorias_casa);
		
		Resources res= getResources();
		
		TabHost tab_Host= (TabHost)findViewById(android.R.id.tabhost);
		tab_Host.setup();
		
		TabHost.TabSpec tab_TE= tab_Host.newTabSpec("tab_TEscenario");
		tab_TE.setContent(R.id.tab_TEscenarios);
		intent= new Intent().setClass(this, ListaTipoEscenariosActivity.class);
		tab_TE.setIndicator("",res.getDrawable(R.drawable.gohome)).setContent(intent);
		tab_Host.addTab(tab_TE);
		
		TabHost.TabSpec tab_TD= tab_Host.newTabSpec("tab_TDispositivo");
		tab_TD.setContent(R.id.tab_TDispositivos);
		intent= new Intent().setClass(this, ListaTipoDispositivosActivity.class);
		tab_TD.setIndicator("",res.getDrawable(R.drawable.usb_hd_64)).setContent(intent);
		tab_Host.addTab(tab_TD);
		
		tab_Host.setCurrentTab(0);
		
		tab_Host.setOnTabChangedListener(new OnTabChangeListener() {
		    @Override
		    public void onTabChanged(String tabId) {
		    	//Toast.makeText(CategoriasCasaActivity.this, String.valueOf("Tab pulsado: "+tabId), Toast.LENGTH_SHORT).show();
		    }
		});
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.categorias_casa, menu);
		return true;
	}

	@Override
	public void onClick(View arg0) {
		// TODO Auto-generated method stub
		
	}

}
